import 'dart:convert';

class DeviceLocationEntity {
  DeviceLocationEntity({
    required this.id,
    required this.mode,
    required this.name,
    required this.type,
    required this.uiMode,
    required this.options,
    required this.positions,
  });

  factory DeviceLocationEntity.fromRawJson(String str) => DeviceLocationEntity.fromJson(json.decode(str) as Map<String, dynamic>);

  factory DeviceLocationEntity.fromJson(Map<String, dynamic> json) => DeviceLocationEntity(
        id: json['id'] as String,
        mode: json['mode'] as String,
        name: json['name'] as String,
        type: json['type'] as String,
        uiMode: json['UIMode'] as String,
        options: Options.fromJson(json['options'] as Map<String, dynamic>),
        positions: List<dynamic>.from(json['positions'].map((x) => x?.toDouble()) as Iterable),
      );

  String id;
  String mode;
  String name;
  String type;
  String uiMode;
  Options options;
  List<dynamic> positions;

  String toRawJson() => json.encode(toJson());

  Map<String, dynamic> toJson() => {
        'id': id,
        'mode': mode,
        'name': name,
        'type': type,
        'UIMode': uiMode,
        'options': options.toJson(),
        'positions': List<dynamic>.from(positions.map((x) => x)),
      };

  @override
  String toString() {
    return 'DeviceLocationEntity{id: $id, mode: $mode, name: $name, type: $type, uiMode: $uiMode, options: $options, positions: $positions}';
  }
}

class Options {
  Options();

  factory Options.fromJson(Map<String, dynamic> json) => Options();

  factory Options.fromRawJson(String str) => Options.fromJson(json.decode(str) as Map<String, dynamic>);

  String toRawJson() => json.encode(toJson());

  Map<String, dynamic> toJson() => {};
}
